package bhz.base.conn011;

public class Singletion {

	private static class InnerSingletion {
		private static Singletion single = new Singletion();
	}

	public static Singletion getInstance() {
		return InnerSingletion.single;
	}

	public static void main(String[] args) {
		Thread t1 = new Thread(new Runnable() {
			@Override
			public void run() {
				Singletion instance = getInstance();
				System.out.println(instance.hashCode());
			}
		});
		Thread t2 = new Thread(new Runnable() {
			@Override
			public void run() {
				Singletion instance = getInstance();
				System.out.println(instance.hashCode());
			}
		});
		t1.start();
		t2.start();
	}
}